package cn.edu.ctbu.kcsj.service;

import cn.edu.ctbu.kcsj.domain.Course;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface CourseService {
    Course getByTno(Integer tno);
    List<Course> findAll();

    /**
     * 只分页的查询
     * @param pageable
     * @return
     */
    Page<Course> findAll(Pageable pageable);

    /**
     * 分页，带过滤的查询
     * @param course
     * @param pageable
     * @return
     */
    Page<Course>findAll(Example<Course> course, Pageable pageable);
    Course getByCid(Integer cid);

    Course insert(Course course);

    Course update(Course course);

    void delete(Integer tno);
}
